package com.woniuxy.mail.rabbit_demo.service;

import com.study.util.ResponseResult;
import com.woniuxy.mail.rabbit_demo.entity.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author fengbenpeng
 * @description: TODO
 * @date 2022/3/14 19:48
 */
//被调用方的服务名
@FeignClient("service-order")
@Component
public interface OrderService {
    /**
     * 通过openfen 远程调用
     * @param id
     * @return
     */

    @RequestMapping("/order/delete/{id}")
    public ResponseResult deleteOrderById(@PathVariable String id);


    @GetMapping("/order/payOrder/{id}")
    public ResponseResult payOrder(@PathVariable("id") String id);

    @GetMapping("/order/getByOrderNo/{orderNumber}")
    public ResponseResult getByOrderNo(@PathVariable("orderNumber") String orderNo);

    /**
     * 根据订单id查询订单
     * @param id
     * @return
     */
    @RequestMapping("/order/find/{id}")
    public ResponseResult<Order> findOrderById(@RequestParam String id);











}
